package com.zipou.framework.gwt.client.widget.suggest;

import com.google.gwt.event.logical.shared.SelectionEvent;
import com.google.gwt.event.logical.shared.SelectionHandler;
import com.google.gwt.user.client.rpc.IsSerializable;

public abstract class MySelectionHandler<T extends IsSerializable> implements SelectionHandler{

	public abstract void onSelected(T selected);
	
	@Override
	public void onSelection(SelectionEvent event) {
		GenericMultiWordSuggestion<T> suggestion = (GenericMultiWordSuggestion<T>) event.getSelectedItem();
		this.onSelected(suggestion.getDTO());
	}
}
